/-imports
/-storage ...
/-storage/attached ...
/-storage/attached/api
LocalStorageStorage.ts
WebSQLStorage.ts
/-typings
stringUtils.ts
teapo.html
100
 
101
                var tablesToMigrate = 0;
102
                var migratedTables = 0;
103
                var cycleCompleted = false;
104
                var anyError = false;
105
 
106
                for (var file in filesByName) if (filesByName.hasOwnProperty(file)) {
107
                  tablesToMigrate++;
108
 
109
                  this._migrateTable(
110
                    transaction,
111
                    name,
112
                    filesByName[name],
113
                    sqlError => {
114
                      if (error) {
115
                        anyError = true;
116
                        callback(wrapSQLError(error), null);
117
                        return;
118
                      }
119
 
120
                      migratedTables++;
121
 
122
                      if (!anyError && migratedTables === tablesToMigrate && cycleCompleted)
123
                        callback(null, new UpdateStorage(this._db));
124
                    });
125
                }
126
 
127
                cycleCompleted = true;
128
                if (!anyError && migratedTables === tablesToMigrate)
129
                  callback(null, new UpdateStorage(this._db));
130
              });
131
 
132
          },
133
          sqlError => callback(wrapSQLError(sqlError), null));
134
 
135
      }
136
 
137
      private _dropAllTables(transaction: SQLTransaction, callback: (error: SQLError) => void) { 
138
        throw null;
139
      }
140
 
141
      private _migrateTable(
142
        transaction: SQLTransaction,
143
        file: string,
144
        properties: { [name: string]: string; },
145
        callback: (error: SQLError) => void) { 
146
 
147
        throw null;
148
        // CREATE TABLE
149
        
150
        for (var propertyName in properties) if (properties.hasOwnProperty(propertyName)) {
151
          var value = properties[propertyName];
152
          
153
          //UPDATE
154
 
155
        }
156
      }
157
 
158
      private _processTableNames(transaction: SQLTransaction, result: SQLResultSet, recipient: LoadStorageRecipient) {
159
 
160
        var length = result && result.rows ? result.rows.length : 0;
161
 
162
        var ftab = this._extractFileNames(result);
163
        if (!ftab.length){
164
          recipient.completed(new UpdateStorage(this._db));
165
          return;
166
        }
167
 
168
        var anyError = false;
169
        var reportedFileCount = 0;
170
        ftab.forEach(ft=> {
171
          transaction.executeSql(
172
            'SELECT * FROM "' + ft.table + '"',